using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Castle.Core.Logging;
using Castle.Services.Transaction;

using Redboil.Bfp.Core;
using Redboil.Bss.Service;
using Redboil.Bss.Dao;

namespace Redboil.Bss.Component {
    [Transactional]
    public class Test4GeneComponent : ComponentBase, ISampleService {

        #region Fields

        private ITest4GeneDao test4GeneDao;

        #endregion

        #region Properties

        

        #endregion

        public Test4GeneComponent(ILogger logger, ITest4GeneDao test4GeneDao) : base(logger) {
            this.test4GeneDao = test4GeneDao;
        }

        [Transaction(TransactionMode.Requires)]
        public void TransactionTest() {
            bool isUserExist = test4GeneDao.ExistenceUserName("Username");
            if(isUserExist == true) logger.Debug("The username is exist");
            else logger.Debug("The username is not exist");
        }

        public void LoggingTest() {
            bool isUserExist = test4GeneDao.ExistenceUserName("Username");
            if(isUserExist == true) logger.Debug("The username is exist");
            else logger.Debug("The username is not exist");
        }
    }
}

namespace Bss {
	namespace Component {
		[Transactional]
		public class Test4GeneComponent : ComponentBase, ISampleService {

			private ITest4GeneDao test4GeneDao;

			public Test4GeneComponent(){

			}

			public override void Dispose(){

			}

			protected override void Finalize(){
				base.Finalize();
			}

			/// 
			/// <param name="logger"></param>
			/// <param name="test4GeneDao"></param>
			public Test4GeneComponent(ILogger logger, ITest4GeneDao test4GeneDao): base(logger){

			}

			[Transaction(TransactionMode.Requires)]
			public void TransactionTest(){

			}

			public void LoggingTest(){

			}

		}//end Test4GeneComponent

	}//end namespace Component

}//end namespace Bss
